package 贫困等级;

import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class JavaBean implements WritableComparable<JavaBean> {
    private String area;
    private String street;
    private String committee;
    private String name;
    private String id;
    private String Identity_categories;
    private String Physical_condition;
    private String Approval_time;
    private double money;

    public int compareTo(JavaBean o) {
        return o.area.compareTo(this.area);
    }

    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(area);
        dataOutput.writeUTF(street);
        dataOutput.writeUTF(committee);
        dataOutput.writeUTF(name);
        dataOutput.writeUTF(id);
        dataOutput.writeUTF(Identity_categories);
        dataOutput.writeUTF(Physical_condition);
        dataOutput.writeUTF(Approval_time);
        dataOutput.writeDouble(money);
    }

    public void readFields(DataInput dataInput) throws IOException {
        area = dataInput.readUTF();
        street = dataInput.readUTF();
        committee = dataInput.readUTF();
        name = dataInput.readUTF();
        id = dataInput.readUTF();
        Identity_categories = dataInput.readUTF();
        Physical_condition = dataInput.readUTF();
        Approval_time = dataInput.readUTF();
        money = dataInput.readDouble();
    }

    public void set(String area, String street, String committee, String name, String id, String identity_categories, String physical_condition, String approval_time, double money) {
        this.area = area;
        this.street = street;
        this.committee = committee;
        this.name = name;
        this.id = id;
        Identity_categories = identity_categories;
        Physical_condition = physical_condition;
        Approval_time = approval_time;
        this.money = money;
    }

    @Override
    public String toString() {
        return area + '\t' +
                street + '\t' +
                committee + '\t' +
                name + '\t' +
                id + "\t" +
                Identity_categories + '\t' +
                Physical_condition + '\t' +
                Approval_time + '\t' +
                money;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getCommittee() {
        return committee;
    }

    public void setCommittee(String committee) {
        this.committee = committee;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIdentity_categories() {
        return Identity_categories;
    }

    public void setIdentity_categories(String identity_categories) {
        Identity_categories = identity_categories;
    }

    public String getPhysical_condition() {
        return Physical_condition;
    }

    public void setPhysical_condition(String physical_condition) {
        Physical_condition = physical_condition;
    }

    public String getApproval_time() {
        return Approval_time;
    }

    public void setApproval_time(String approval_time) {
        Approval_time = approval_time;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}
